package com.zzh.lib.recorder.whole.record.beans;


import android.os.Parcel;
import android.os.Parcelable;

/**
 * Created by ZZH on 2021/11/30.
 *
 * @Date: 2021/11/30
 * @Email: zzh_hz@126.com
 * @QQ: 1299234582
 * @Author: zzh
 * @Description:
 */
public class RecordUIParams implements Parcelable {
    public boolean showSwitchCamera = false;
    public boolean showLocalVideo = false;
    public boolean showBeautyFilter = false;
    public boolean showNext = false;
    public String fileVideoSavePath;

    public RecordUIParams setShowSwitchCamera(boolean showSwitchCamera) {
        this.showSwitchCamera = showSwitchCamera;
        return this;
    }

    public RecordUIParams setShowLocalVideo(boolean showLocalVideo) {
        this.showLocalVideo = showLocalVideo;
        return this;
    }

    public RecordUIParams setShowBeautyFilter(boolean showBeautyFilter) {
        this.showBeautyFilter = showBeautyFilter;
        return this;
    }

    public RecordUIParams setFileVideoSavePath(String fileVideoSavePath) {
        this.fileVideoSavePath = fileVideoSavePath;
        return this;
    }

    public RecordUIParams setShowNext(boolean showNext) {
        this.showNext = showNext;
        return this;
    }


    public RecordUIParams() {
    }


    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeByte(this.showSwitchCamera ? (byte) 1 : (byte) 0);
        dest.writeByte(this.showLocalVideo ? (byte) 1 : (byte) 0);
        dest.writeByte(this.showBeautyFilter ? (byte) 1 : (byte) 0);
        dest.writeByte(this.showNext ? (byte) 1 : (byte) 0);
        dest.writeString(this.fileVideoSavePath);
    }

    public void readFromParcel(Parcel source) {
        this.showSwitchCamera = source.readByte() != 0;
        this.showLocalVideo = source.readByte() != 0;
        this.showBeautyFilter = source.readByte() != 0;
        this.showNext = source.readByte() != 0;
        this.fileVideoSavePath = source.readString();
    }

    protected RecordUIParams(Parcel in) {
        this.showSwitchCamera = in.readByte() != 0;
        this.showLocalVideo = in.readByte() != 0;
        this.showBeautyFilter = in.readByte() != 0;
        this.showNext = in.readByte() != 0;
        this.fileVideoSavePath = in.readString();
    }

    public static final Parcelable.Creator<RecordUIParams> CREATOR = new Parcelable.Creator<RecordUIParams>() {
        @Override
        public RecordUIParams createFromParcel(Parcel source) {
            return new RecordUIParams(source);
        }

        @Override
        public RecordUIParams[] newArray(int size) {
            return new RecordUIParams[size];
        }
    };
}
